using System.Threading.Tasks;
using System.Collections.Generic;
using JGSY.CMS.LowCode.Platform.Application.DTOs;

namespace JGSY.CMS.LowCode.Platform.Application.Interfaces
{
    /// <summary>
    /// 内容发布应用服务接口。
    /// 提供内容发布、取消发布、发布历史查询、发布队列管理等发布相关功能接口定义。
    /// </summary>
    public interface IPublishingAppService
    {
        /// <summary>
        /// 发布内容
        /// </summary>
        /// <param name="contentId">内容标识符</param>
        /// <param name="publishTime">发布时间（可选）</param>
        /// <param name="targetEnvironment">目标环境（可选）</param>
        /// <returns>发布任务</returns>
        Task PublishAsync(long contentId, string? publishTime = null, string? targetEnvironment = null);
        
        /// <summary>
        /// 取消发布内容
        /// </summary>
        /// <param name="contentId">内容标识符</param>
        /// <returns>取消发布任务</returns>
        Task UnpublishAsync(long contentId);
        
        /// <summary>
        /// 获取发布历史
        /// </summary>
        /// <param name="contentId">内容标识符</param>
        /// <param name="page">页码</param>
        /// <param name="limit">每页数量</param>
        /// <returns>发布历史记录列表</returns>
        Task<IEnumerable<PublishHistoryDto>> GetPublishHistory(long contentId, int page = 1, int limit = 10);
        
        /// <summary>
        /// 获取发布队列
        /// </summary>
        /// <param name="status">发布状态（可选）</param>
        /// <param name="page">页码</param>
        /// <param name="limit">每页数量</param>
        /// <returns>发布队列列表</returns>
        Task<IEnumerable<PublishQueueDto>> GetPublishQueueAsync(string? status = null, int page = 1, int limit = 10);
    }
}
